{%extend name="Public:layout"/%}

{%block name="title"%}
<h2 class="mb20">
    定时推送
</h2>
{%/block%}

{%block name="contents"%}
<table class="table table-listing table-hovered">
    <thead class="thead-gray">
    <tr>
        <th>类型</th>
        <th>ID</th>
        <th class="span6">编辑</th>
        <th>定时时间</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {%notempty name="list"%}
    {%foreach name="list" item="vo" %}
    {%php%}$myData=json_decode($vo['data'],1);{%/php%}
    <tr>
        <td>{%$myData.type%}</td>
        <td>{%$myData.about_id%}</td>
        <td>{%$myData.editor_name%}</td>
        <td>{%$vo.auto_publish_time|date='Y-m-d H:i',###%}</td>
        <td>{%eq name="vo['status']" value="1"%}<font color="green">已处理</font>{%else/%}待执行{%/eq%}</td>
        <td>
            <a href="javascript:;" onclick="ST.todo('del','{%$vo.id%}')" class="mr5"><i class="icon i-del"></i></a>
        </td>
    </tr>
    {%/foreach%}
    {%/notempty%}
    </tbody>
</table>
<h2 class="m20"></h2>
<div class="paging">{%$page%}</div>
{%/block%}

{%block name="js"%}
<script type="text/javascript">
    $.extend(ST, {
        del: function (id) {
            ST.execAJAX({
                url: "{%:U('/admin/weixin/del_weibo')%}",     //服务端请求地址
                params: {id: id},       //发送到服务端的参数（如：{myparam:1}）
                massage: '确定删除吗？',       //提示信息（仅hasconfirm为true时有用）
                hasconfirm: true,       //提交前是否显示确认框
                succFun: function (j) {  //成功后的回调方法：刷新页面
                    if (!j) return;
                    if (j.data && j.data.url) {
                        location.href = j.data.url;
                    } else {
                        ST.reload();
                    }
                }
            });
        }
    });
    ST.init();
</script>
{%/block%}
